package java_DesignPattern.StructuralPattern.DecoraterPattern;

/**
 * 装饰器模式---测试类
 */
public class Test {

    public static void main(String[] args) {

        FastFood fastFood = new FiredNoodle();
        //加一个鸡蛋
        fastFood = new Egg(fastFood);
        //加一个蔬菜
        fastFood = new ShuCai(fastFood);

        System.out.println(fastFood.getName());
        System.out.println(fastFood.calcPrice());
    }
}
